setUpBeforeClass{
  StaticHandler.clear();
  StaticHandler.addDelegate(new JPAHandler());
  StaticHandler.addDelegate(new RepoHandler());
  weld=new Weld();
  container=weld.initialize();
  Set<Bean<?>> beans=container.getBeanManager().getBeans(org.apache.ode.spi.repo.Repository.class,new AnnotationLiteral<Any>(){
  if (beans.size() > 0) {
    repoBean=(Bean<org.apache.ode.spi.repo.Repository>)beans.iterator().next();
    repoCtx=container.getBeanManager().createCreationalContext(repoBean);
    repo=(org.apache.ode.spi.repo.Repository)container.getBeanManager().getReference(repoBean,org.apache.ode.spi.repo.Repository.class,repoCtx);
 else {
  beans=container.getBeanManager().getBeans(Repository.class,new AnnotationLiteral<Any>(){
  if (beans.size() > 0) {
    jmxRepoBean=(Bean<Repository>)beans.iterator().next();
    jmxRepoCtx=container.getBeanManager().createCreationalContext(jmxRepoBean);
    jmxRepo=(Repository)container.getBeanManager().getReference(jmxRepoBean,Repository.class,jmxRepoCtx);
 else {
}
tearDownAfterClass{
  if (repo != null) {
    repoBean.destroy(repo,repoCtx);
  if (jmxRepo != null) {
    jmxRepoBean.destroy(jmxRepo,jmxRepoCtx);
  try {
    weld.shutdown();
 catch (  NullPointerException e) {
}
testRepo{
  assertNotNull(repo);
  assertNotNull(id);
  byte[] contents=jmxRepo.exportArtifact(id);
  jmxRepo.removeArtifact(id);
  assertFalse(repo.exists(QName.valueOf(id.getName()),id.getType(),id.getVersion()));
}
